893052b0042b3cd37807dcaa6dd5a583baacd96e,src/main/java/jace/apple2e/MOS65C02.java,MOS65C02,executeOpcode,#,1041
Before Change
int op = 0x00ff & getMemory().read(pc, TYPE.EXECUTE, true, false);
OPCODE opcode = opcodes[op];
if (traceEntry != null && warnAboutExtendedOpcodes && opcode != null && opcode.isExtendedOpcode) {
System.out.println(">>EXTENDED OPCODE DETECTED " + Integer.toHexString(opcode.code) + "<<");
System.out.println(traceEntry);
if (isLogEnabled()) {
log(">>EXTENDED OPCODE DETECTED " + Integer.toHexString(opcode.code) + "<<");
log(traceEntry);
}
}
if (opcode == null) {
// handle bad opcode as a NOP
int wait = 0;
int bytes = 2;
int n = op & 0x0f;
switch (n) {
case 2:
wait = 2;
break;
case 3:
case 7:
case 0x0b:
case 0x0f:
wait = 1;
bytes = 1;
break;
case 4:
bytes = 2;
if ((op & 0x0f0) == 0x040) {
wait = 3;
} else {
wait = 4;
} break;
case 0x0c:
bytes = 3;
if ((op & 0x0f0) == 0x050) {
wait = 8;
} else {
wait = 4;
} break;
default:
}
incrementProgramCounter(bytes);
addWaitCycles(wait);
if (isLogEnabled() || breakOnBadOpcode) {
System.out.println("Unrecognized opcode "
+ Integer.toHexString(op)
+ " at " + Integer.toHexString(pc));
}
if (breakOnBadOpcode) {
OPCODE.BRK.execute(this);
After Change
int op = 0x00ff & getMemory().read(pc, TYPE.EXECUTE, true, false);
OPCODE opcode = opcodes[op];
if (traceEntry != null && warnAboutExtendedOpcodes && opcode != null && opcode.isExtendedOpcode) {
LOG.log(Level.WARNING, ">>EXTENDED OPCODE DETECTED {0}<<", Integer.toHexString(opcode.code));
LOG.log(Level.WARNING, traceEntry);
if (isLogEnabled()) {
log(">>EXTENDED OPCODE DETECTED " + Integer.toHexString(opcode.code) + "<<");